#!/bin/sh

sudo cp -a /etc/apt/sources.list /etc/apt/sources.list.bak

sudo sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list
sudo apt-get -y update
sudo apt-get -y upgrade --fix-missing
sudo apt -y upgrade --fix-missing
sudo apt-get -y install cmake tmux zsh zsh-antigen lrzsz  python3-pip autojump ranger fzf sysstat iotop glances gdb
sudo apt-get -y install linux-headers-$(uname -r)
sudo curl -L https://gitee.com/ZeloZhang/manjaro/raw/master/antigen/antigen.zsh -o /usr/share/zsh-antigen/antigen.zsh

curl -L  "https://gitee.com/ZeloZhang/manjaro/raw/master/zsh/ubuntu_zshrc"  -o  ~/.zshrc
sed -i 's/zsh\/share/zsh-antigen/g' ~/.zshrc 
chsh -s /bin/zsh

cd
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
#cp .tmux/.tmux.conf.local .
curl -L "https://gitee.com/ZeloZhang/manjaro/raw/master/tmux/tmux.conf.local" -o ~/.tmux.conf.local
mkdir ~/.pip
echo "[global]
index-url = https://repo.huaweicloud.com/repository/pypi/simple
trusted-host = repo.huaweicloud.com
timeout = 120" > ~/.pip/pip.conf


sudo apt-get install -y build-essential python3-pyelftools   libnuma-dev meson 
sudo pip3 install ninja 

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun


sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://w5z91a3d.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo groupadd docker     #添加docker用户组
sudo gpasswd -a $USER docker     #将登陆用户加入到docker用户组中
newgrp docker     #更新用户组
docker ps    #测试docker命令是否可以使用sudo正常使用
